package com.biz.model.Hmodel.order;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lzq.
 */

@Entity
@Table(name = "order_main")
public class TOrderMain {
    private String id;
    private String code;
    private String buyUserId;
    private Double goodsTotal;
    private Double payTotal;
    private Short state;
    private Short isdel;
    private Date createTime;
    private Date confirmTime;
    private Short isClosed;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "buyUserId")
    public String getBuyUserId() {
        return buyUserId;
    }

    public void setBuyUserId(String buyUserId) {
        this.buyUserId = buyUserId;
    }

    @Basic
    @Column(name = "goodsTotal")
    public Double getGoodsTotal() {
        return goodsTotal;
    }

    public void setGoodsTotal(Double goodsTotal) {
        this.goodsTotal = goodsTotal;
    }

    @Basic
    @Column(name = "payTotal")
    public Double getPayTotal() {
        return payTotal;
    }

    public void setPayTotal(Double payTotal) {
        this.payTotal = payTotal;
    }

    @Basic
    @Column(name = "state")
    public Short getState() {
        return state;
    }

    public void setState(Short state) {
        this.state = state;
    }

    @Basic
    @Column(name = "isdel")
    public Short getIsdel() {
        return isdel;
    }

    public void setIsdel(Short isdel) {
        this.isdel = isdel;
    }

    @Basic
    @Column(name = "createTime")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "confirmTime")
    public Date getConfirmTime() {
        return confirmTime;
    }

    public void setConfirmTime(Date confirmTime) {
        this.confirmTime = confirmTime;
    }

    @Basic
    @Column(name = "isClosed")
    public Short getIsClosed() {
        return isClosed;
    }

    public void setIsClosed(Short isClosed) {
        this.isClosed = isClosed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TOrderMain that = (TOrderMain) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (buyUserId != null ? !buyUserId.equals(that.buyUserId) : that.buyUserId != null) return false;
        if (goodsTotal != null ? !goodsTotal.equals(that.goodsTotal) : that.goodsTotal != null) return false;
        if (payTotal != null ? !payTotal.equals(that.payTotal) : that.payTotal != null) return false;
        if (state != null ? !state.equals(that.state) : that.state != null) return false;
        if (isdel != null ? !isdel.equals(that.isdel) : that.isdel != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (confirmTime != null ? !confirmTime.equals(that.confirmTime) : that.confirmTime != null) return false;
        if (isClosed != null ? !isClosed.equals(that.isClosed) : that.isClosed != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (buyUserId != null ? buyUserId.hashCode() : 0);
        result = 31 * result + (goodsTotal != null ? goodsTotal.hashCode() : 0);
        result = 31 * result + (payTotal != null ? payTotal.hashCode() : 0);
        result = 31 * result + (state != null ? state.hashCode() : 0);
        result = 31 * result + (isdel != null ? isdel.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (confirmTime != null ? confirmTime.hashCode() : 0);
        result = 31 * result + (isClosed != null ? isClosed.hashCode() : 0);
        return result;
    }
}
